import React, {Component} from "react";

class ShowList extends Component {
    onItemClick(item, i) {
        this.props.onItemClick(item, i);
    }

    render() {
        return (
            <div>
                {this.props.result.map((item, i) => (
                    <h1 key={i} onClick={() => this.onItemClick(item, i)}>{item.title}</h1>
                ))}
            </div>
        )
    }
}

export default ShowList;

